import {proxy} from "@@/exports";
import {NotifyVO} from "@/services/NotifyService";

interface NotifyModelType {
    notify?: NotifyVO;
    updateModalState: boolean;
}

const state = proxy<NotifyModelType>({
    notify: undefined,
    updateModalState: false,
})

const actions = {
    /**
     * 设置修改模态框状态
     * @param modalState 状态
     */
    setUpdateModalState(modalState: boolean) {
        state.updateModalState = modalState
    },
    /**
     * 打开模态框
     * @param modalState
     * @param notify
     */
    openUpdateModal(modalState: boolean, notify?: NotifyVO) {
        state.notify = notify
        state.updateModalState = modalState
    },
};


export const NotifyModel = {state, actions}